<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // const obj = {
        //     name: '于明洋',
        //     age: 77,
        //     sex: '女',
        //     hobby: '玩',
        // }

        // let { name, age, sex, hobby } = obj;

        // console.log(name, sex, age, hobby);

        // 属性名和变量名不一样
        // const obj = { name1: '于明洋', age: 100, };

        // let {
        //     name1: name,
        //     age,
        // } = obj

        // console.log(name, age);

        const obj = {
            name1: '于明杨',
            age: 108,
            msg: 'test',
        }

        let {
            name1: name,
            age,
            msg = '于明杨大傻逼'
        } = obj;

        console.log(name, age, msg);

    </script>
</body>

</html>